/*
 * @Author: your name
 * @Date: 2019-07-14 13:04:32
 * @LastEditTime: 2021-03-02 14:08:28
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \HMI\src\main.js
 */
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import VCharts from 'v-charts'
import 'u-reset.css'
import Vuex from './store'
import api from '@/api'
import NercarTablePage from './components/NercarTable.vue';
import http from "@/config/http.js"
import {post} from "@/config/request.js"

Vue.config.productionTip = false;
Vue.component('NercarTable', NercarTablePage)
Vue.prototype.$http = http
Vue.prototype.$api = api;
Vue.prototype.$post = post;

router.beforeEach((to, from, next) => {
	if(localStorage.getItem('userID') || to.path ==='/' ){
		next()
	}else{
		next({path:"/"})
	}
})

Vue.use(ElementUI)
Vue.use(VCharts)
new Vue({
	router,
	Vuex,
	render: h => h(App)
}).$mount('#app')
